﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BonjourHotel.Model;

namespace BonjourHotel.Core.Rooms
{
    public class RoomFacade : FacadeBase<Room>
    {
        public Room GetRoom(int idRoom)
        {
            var Room = (from room in base.ObjectContext.RoomSet
                        where room.idRoom == idRoom
                        select room).FirstOrDefault();

            return Room;
        }

        public List<Room> GetAllRooms()
        {
            var Rooms = from room in base.ObjectContext.RoomSet
                        orderby room.Name
                        select room;

            return Rooms.ToList();
        }
    }
}
